function add_remove_fav_item(checkbox){
    try{
        value = checkbox.value;
        values = value.split(':');
        fav_prod_id = values[0];
        fav_list_id = values[1];
        op = null;        
        op = checkbox.checked ? "add" : "del";

        $.ajax({
            type:"POST",
            dataType:'json',
            data:"is_ajax=1&op="+op+"&fav_prod_id="+fav_prod_id+"&fav_list_id="+fav_list_id,
            url: base_index_url+"/favorite/my_fav/add_del_fav_item",
            success: function(data) {
                
            },
            complete :  function(data){
            //alert("done");
            }
        });
        
    }catch(e){

    }
}
function auto_select_fav_items(){
    $(document).ready(function() {
        $('.fav_checkbox').each(function(){
            values = this.value.split(':');
            fav_prod_id = values[0];
            fav_list_id = values[1];
            $.ajax({
                param:this,
                type:"POST",
                dataType:'json',
                data:"is_ajax=1&"+"&fav_prod_id="+fav_prod_id+"&fav_list_id="+fav_list_id,
                url: base_index_url+"/favorite/my_fav/fav_entry_exists/",
                success: function(data) {
                    if(data=='y'){
                        this.param.checked = true;
                    }else{
                        this.param.chceked = false;
                    }
                },
                complete :  function(data){           
                }
            });
        });
    });
}